#pragma once

#include "IncidenceGraph.h"


#include <string>
#include <sstream>
#include <fstream>
#include <iostream>		// cout
using namespace std;


class GraphReader
{
public:
	GraphReader(IncidenceGraph& graph);
	~GraphReader();

	bool Read(string fileName);

protected:
	bool ReadAdjacencyMatrix(ifstream& ifs);
	bool ReadAdjacencyList(ifstream& ifs);

	template<typename TTo, typename TFrom>
	TTo lexical_cast(TFrom const &x);

private:
	IncidenceGraph& graph;
};

